using UnityEngine;
using UnityEngine.UI;

public class UIActivityNode : MonoBehaviour
{
	public int id;

	public Text star;

	private RectTransform _rectTrans;

	public UIActivity parentUI;

	public GameObject activityWnd;

	public Button btnGift;

	public GameObject effectGO;

	public Vector2 position
	{
		set
		{
			_rectTrans.anchoredPosition = value;
		}
	}

	private void Awake()
	{
		_rectTrans = base.gameObject.GetComponent<RectTransform>();
	}

	private void Start()
	{
		base.transform.localScale = new Vector3(0.5f, 0.5f, 0.5f);
		bool flag = ActivityManager.instance.IsTakenPrize(id);
		btnGift.interactable = !flag;
		effectGO.SetActive(!flag && ActivityManager.instance.CanTakePrize(id));
	}

	private void Update()
	{
	}

	private void OnEnable()
	{
		bool flag = ActivityManager.instance.IsTakenPrize(id);
		effectGO.SetActive(!flag && ActivityManager.instance.CanTakePrize(id));
	}

	public void OnClick()
	{
		parentUI.OpenPrizeWnd(id);
	}

	public void TakePrize()
	{
		btnGift.interactable = false;
		effectGO.SetActive(value: false);
	}
}
